package com.cq.hd.product.mapper;

import com.cq.hd.product.api.dto.*;
import com.cq.hd.product.api.vo.*;
import com.cq.hd.product.po.TbActivePo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 活动表 Mapper 接口
 * </p>
 *
 * @author mYunYu
 * @since 2023-11-23
 */
@Mapper
public interface TbActiveMapper extends BaseMapper<TbActivePo> {

    List<AppMyActivePageVo> listMyActiveByDto(AppMyActivePageDto appMyActivePageDto);

    List<IndexActivePageVo> listIndexActiveByDto(IndexActivePageDto indexActivePageDto);

    List<AdminActivePageVo> listAdminActiveByDto(AdminActivePageDto adminActivePageDto);

    List<SearchBusinessActiveVo> listSearchBusinessActive(@Param("businessIds") List<Long> businessIds,
                                                          @Param("activeStates") List<Integer> activeStates,
                                                          @Param("nowTime") String nowTime);

    List<BusinessHomeActivePageVo> listHomeActiveByDto(BusinessHomeActivePageDto businessHomeActivePageDto);

    List<ActivePageVo> listByDto(ActiveDto activeDto);

    int subActiveStock(@Param("activeId") Long activeId, @Param("num") Integer num);

    int addActiveStock(@Param("activeId") Long activeId, @Param("num") Integer num);

    int addTotalAndRemainStock(@Param("activeId") Long activeId, @Param("num") Integer num);

    int updateState(UpdateActiveStateDto updateActiveStateDto);

    Set<String> listCityName();

}
